home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 21 / Cream of the Crop 21 (Terry Blount) (October 1996).iso / doom / quake.zip / FEIGN_V9.ZIP / PLAYER.QC < prev    next >
Text File  |  1996-08-01  |  18KB  |  666 lines

  1.  
  2. void() bubble_bob;
  3.  
  4. /*
  5. ==============================================================================
  6.  
  7. PLAYER
  8.  
  9. ==============================================================================
  10. */
  11.  
  12. $cd /raid/quake/id1/models/player_4
  13. $origin 0 -6 24
  14. $base base        
  15. $skin skin
  16.  
  17. //
  18. // running
  19. //
  20. $frame axrun1 axrun2 axrun3 axrun4 axrun5 axrun6
  21.  
  22. $frame rockrun1 rockrun2 rockrun3 rockrun4 rockrun5 rockrun6
  23.  
  24. //
  25. // standing
  26. //
  27. $frame stand1 stand2 stand3 stand4 stand5
  28.  
  29. $frame axstnd1 axstnd2 axstnd3 axstnd4 axstnd5 axstnd6
  30. $frame axstnd7 axstnd8 axstnd9 axstnd10 axstnd11 axstnd12
  31.  
  32.  
  33. //
  34. // pain
  35. //
  36. $frame axpain1 axpain2 axpain3 axpain4 axpain5 axpain6
  37.  
  38. $frame pain1 pain2 pain3 pain4 pain5 pain6
  39.  
  40.  
  41. //
  42. // death
  43. //
  44.  
  45. $frame axdeth1 axdeth2 axdeth3 axdeth4 axdeth5 axdeth6
  46. $frame axdeth7 axdeth8 axdeth9
  47.  
  48. $frame deatha1 deatha2 deatha3 deatha4 deatha5 deatha6 deatha7 deatha8
  49. $frame deatha9 deatha10 deatha11
  50.  
  51. $frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8
  52. $frame deathb9
  53.  
  54. $frame deathc1 deathc2 deathc3 deathc4 deathc5 deathc6 deathc7 deathc8
  55. $frame deathc9 deathc10 deathc11 deathc12 deathc13 deathc14 deathc15
  56.  
  57. $frame deathd1 deathd2 deathd3 deathd4 deathd5 deathd6 deathd7
  58. $frame deathd8 deathd9
  59.  
  60. $frame deathe1 deathe2 deathe3 deathe4 deathe5 deathe6 deathe7
  61. $frame deathe8 deathe9
  62.  
  63. //
  64. // attacks
  65. //
  66. $frame nailatt1 nailatt2
  67.  
  68. $frame light1 light2
  69.  
  70. $frame rockatt1 rockatt2 rockatt3 rockatt4 rockatt5 rockatt6
  71.  
  72. $frame shotatt1 shotatt2 shotatt3 shotatt4 shotatt5 shotatt6
  73.  
  74. $frame axatt1 axatt2 axatt3 axatt4 axatt5 axatt6
  75.  
  76. $frame axattb1 axattb2 axattb3 axattb4 axattb5 axattb6
  77.  
  78. $frame axattc1 axattc2 axattc3 axattc4 axattc5 axattc6
  79.  
  80. $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
  81.  
  82.  
  83. /*
  84. ==============================================================================
  85. PLAYER
  86. ==============================================================================
  87. */
  88.  
  89. void() player_run;
  90.  
  91. void()    player_stand1 =[    $axstnd1,    player_stand1    ]
  92. {
  93.     self.weaponframe=0;
  94.     if (self.velocity_x || self.velocity_y)
  95.     {
  96.         self.walkframe=0;
  97.         player_run();
  98.         return;
  99.     }
  100.  
  101.     if (self.weapon == IT_AXE)
  102.     {
  103.         if (self.walkframe >= 12)
  104.             self.walkframe = 0;
  105.         self.frame = $axstnd1 + self.walkframe;
  106.     }
  107.     else
  108.     {
  109.         if (self.walkframe >= 5)
  110.             self.walkframe = 0;
  111.         self.frame = $stand1 + self.walkframe;
  112.     }
  113.     self.walkframe = self.walkframe + 1;    
  114. };
  115.  
  116. void()    player_run =[    $rockrun1,    player_run    ]
  117. {
  118.     self.weaponframe=0;
  119.     if (!self.velocity_x && !self.velocity_y)
  120.     {
  121.         self.walkframe=0;
  122.         player_stand1();
  123.         return;
  124.     }
  125.  
  126.     if (self.weapon == IT_AXE)
  127.     {
  128.         if (self.walkframe == 6)
  129.             self.walkframe = 0;
  130.         self.frame = $axrun1 + self.walkframe;
  131.     }
  132.     else
  133.     {
  134.         if (self.walkframe == 6)
  135.             self.walkframe = 0;
  136.         self.frame = self.frame + self.walkframe;
  137.     }
  138.     self.walkframe = self.walkframe + 1;
  139. };
  140.  
  141.  
  142. void()    player_shot1 =    [$shotatt1, player_shot2    ] {self.weaponframe=1;
  143. self.effects = self.effects | EF_MUZZLEFLASH;};
  144. void()    player_shot2 =    [$shotatt2, player_shot3    ] {self.weaponframe=2;};
  145. void()    player_shot3 =    [$shotatt3, player_shot4    ] {self.weaponframe=3;};
  146. void()    player_shot4 =    [$shotatt4, player_shot5    ] {self.weaponframe=4;};
  147. void()    player_shot5 =    [$shotatt5, player_shot6    ] {self.weaponframe=5;};
  148. void()    player_shot6 =    [$shotatt6, player_run    ] {self.weaponframe=6;};
  149.  
  150. void()    player_axe1 =    [$axatt1, player_axe2    ] {self.weaponframe=1;};
  151. void()    player_axe2 =    [$axatt2, player_axe3    ] {self.weaponframe=2;};
  152. void()    player_axe3 =    [$axatt3, player_axe4    ] {self.weaponframe=3;W_FireAxe();};
  153. void()    player_axe4 =    [$axatt4, player_run    ] {self.weaponframe=4;};
  154.  
  155. void()    player_axeb1 =    [$axattb1, player_axeb2    ] {self.weaponframe=5;};
  156. void()    player_axeb2 =    [$axattb2, player_axeb3    ] {self.weaponframe=6;};
  157. void()    player_axeb3 =    [$axattb3, player_axeb4    ] {self.weaponframe=7;W_FireAxe();};
  158. void()    player_axeb4 =    [$axattb4, player_run    ] {self.weaponframe=8;};
  159.  
  160. void()    player_axec1 =    [$axattc1, player_axec2    ] {self.weaponframe=1;};
  161. void()    player_axec2 =    [$axattc2, player_axec3    ] {self.weaponframe=2;};
  162. void()    player_axec3 =    [$axattc3, player_axec4    ] {self.weaponframe=3;W_FireAxe();};
  163. void()    player_axec4 =    [$axattc4, player_run    ] {self.weaponframe=4;};
  164.  
  165. void()    player_axed1 =    [$axattd1, player_axed2    ] {self.weaponframe=5;};
  166. void()    player_axed2 =    [$axattd2, player_axed3    ] {self.weaponframe=6;};
  167. void()    player_axed3 =    [$axattd3, player_axed4    ] {self.weaponframe=7;W_FireAxe();};
  168. void()    player_axed4 =    [$axattd4, player_run    ] {self.weaponframe=8;};
  169.  
  170.  
  171. //============================================================================
  172.  
  173. void() player_nail1   =[$nailatt1, player_nail2  ] 
  174. {
  175.     self.effects = self.effects | EF_MUZZLEFLASH;
  176.  
  177.     if (!self.button0)
  178.         {player_run ();return;}
  179.     self.weaponframe = self.weaponframe + 1;
  180.     if (self.weaponframe == 9)
  181.         self.weaponframe = 1;
  182.     SuperDamageSound();
  183.     W_FireSpikes (4);
  184.     self.attack_finished = time + 0.2;
  185. };
  186. void() player_nail2   =[$nailatt2, player_nail1  ]
  187. {
  188.     self.effects = self.effects | EF_MUZZLEFLASH;
  189.  
  190.     if (!self.button0)
  191.         {player_run ();return;}
  192.     self.weaponframe = self.weaponframe + 1;
  193.     if (self.weaponframe == 9)
  194.         self.weaponframe = 1;
  195.     SuperDamageSound();
  196.     W_FireSpikes (-4);
  197.     self.attack_finished = time + 0.2;
  198. };
  199.  
  200. //============================================================================
  201.  
  202. void() player_light1   =[$light1, player_light2  ] 
  203. {
  204.     self.effects = self.effects | EF_MUZZLEFLASH;
  205.  
  206.     if (!self.button0)
  207.         {player_run ();return;}
  208.     self.weaponframe = self.weaponframe + 1;
  209.     if (self.weaponframe == 5)
  210.         self.weaponframe = 1;
  211.     SuperDamageSound();
  212.     W_FireLightning();
  213.     self.attack_finished = time + 0.2;
  214. };
  215. void() player_light2   =[$light2, player_light1  ]
  216. {
  217.     self.effects = self.effects | EF_MUZZLEFLASH;
  218.  
  219.     if (!self.button0)
  220.         {player_run ();return;}
  221.     self.weaponframe = self.weaponframe + 1;
  222.     if (self.weaponframe == 5)
  223.         self.weaponframe = 1;
  224.     SuperDamageSound();
  225.     W_FireLightning();
  226.     self.attack_finished = time + 0.2;
  227. };
  228.  
  229. //============================================================================
  230.  
  231.  
  232. void() player_rocket1   =[$rockatt1, player_rocket2  ] {self.weaponframe=1;
  233. self.effects = self.effects | EF_MUZZLEFLASH;};
  234. void() player_rocket2   =[$rockatt2, player_rocket3  ] {self.weaponframe=2;};
  235. void() player_rocket3   =[$rockatt3, player_rocket4  ] {self.weaponframe=3;};
  236. void() player_rocket4   =[$rockatt4, player_rocket5  ] {self.weaponframe=4;};
  237. void() player_rocket5   =[$rockatt5, player_rocket6  ] {self.weaponframe=5;};
  238. void() player_rocket6   =[$rockatt6, player_run  ] {self.weaponframe=6;};
  239. void(float num_bubbles) DeathBubbles;
  240.  
  241. void() PainSound =
  242. {
  243. local float        rs;
  244.  
  245.     if (self.health < 0)
  246.         return;
  247.  
  248.     if (damage_attacker.classname == "teledeath")
  249.     {
  250.         sound (self, CHAN_VOICE, "player/teledth1.wav", 1, ATTN_NONE);
  251.         return;
  252.     }
  253.  
  254. // water pain sounds
  255.     if (self.watertype == CONTENT_WATER && self.waterlevel == 3)
  256.     {
  257.         DeathBubbles(1);
  258.         if (random() > 0.5)
  259.             sound (self, CHAN_VOICE, "player/drown1.wav", 1, ATTN_NORM);
  260.         else
  261.             sound (self, CHAN_VOICE, "player/drown2.wav", 1, ATTN_NORM);
  262.         return;
  263.     }
  264.  
  265. // slime pain sounds
  266.     if (self.watertype == CONTENT_SLIME)
  267.     {
  268. // FIX ME    put in some steam here
  269.         if (random() > 0.5)
  270.             sound (self, CHAN_VOICE, "player/lburn1.wav", 1, ATTN_NORM);
  271.         else
  272.             sound (self, CHAN_VOICE, "player/lburn2.wav", 1, ATTN_NORM);
  273.         return;
  274.     }
  275.  
  276.     if (self.watertype == CONTENT_LAVA)
  277.     {
  278.         if (random() > 0.5)
  279.             sound (self, CHAN_VOICE, "player/lburn1.wav", 1, ATTN_NORM);
  280.         else
  281.             sound (self, CHAN_VOICE, "player/lburn2.wav", 1, ATTN_NORM);
  282.         return;
  283.     }
  284.  
  285.     if (self.pain_finished > time)
  286.     {
  287.         self.axhitme = 0;
  288.         return;
  289.     }
  290.     self.pain_finished = time + 0.5;
  291.  
  292. // don't make multiple pain sounds right after each other
  293.  
  294. // ax pain sound
  295.     if (self.axhitme == 1)
  296.     {
  297.         self.axhitme = 0;
  298.         sound (self, CHAN_VOICE, "player/axhit1.wav", 1, ATTN_NORM);
  299.         return;
  300.     }
  301.     
  302.  
  303.     rs = rint((random() * 5) + 1);
  304.  
  305.     self.noise = "";
  306.     if (rs == 1)
  307.         self.noise = "player/pain1.wav";
  308.     else if (rs == 2)